package top.xiaoshuaila.searescue.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;


@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        super.configure(http);
        http.csrf().disable();
    }
    @Override
    public void configure(WebSecurity web) throws Exception {
        //不走Spring SEcurity的过滤器链，也就意味着不会将用户的信息记录在session中,因此尽量不要用这种方式进行资源放行
        //关闭springsecurity服务
        web.ignoring().antMatchers("/**");
    }
}